<%--
  Created by IntelliJ IDEA.
  User: tang
  Date: 2020/4/25
  Time: 15:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>
<head>
    <title>我的商城 | 控制面板</title>
    <jsp:include page="../includs/header.jsp"></jsp:include>
</head>
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">
    <!-- Navbar -->
    <jsp:include page="../includs/nav.jsp"></jsp:include>
    <!-- Main Sidebar Container -->
    <jsp:include page="../includs/menu.jsp"></jsp:include>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <div class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1 class="m-0 text-dark">
                        </h1>
                    </div><!-- /.col -->
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-right">
                            <li class="breadcrumb-item"><a href="/main">主页</a></li>
                            <li class="breadcrumb-item active">${tbUser.id == null ? "新增" : "编辑"}用户</li>
                        </ol>
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.container-fluid -->
        </div>

        <!-- Main content -->
        <section class="content">
            <div class="row align-content-center justify-content-center">
                <div class="col-md-6">
                    <c:if test="${baseResult != null}">
                        <div class="alert alert-${baseResult.status == 200 ? "success" : "danger"} alert-dismissible">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                                ${baseResult.message}
                        </div>
                    </c:if>

                    <div class="card card-primary">
                        <div class="card-header">
                            <h3 class="card-title">新增用户</h3>
                        </div>
                        <!-- /.card-header -->
                        <!-- form start -->
                        <form role="form" id="inputForm" action="/user/save" method="post" modelAttribute="tbUser">
                            <input type="hidden" name="id" value="${tbUser.id}">
                            <div class="card-body">
                                <div class="form-group">
                                    <label for="email">邮箱</label>
                                    <input type="email" name="email" class="form-control" id="email" placeholder="请输入邮箱" value="${tbUser.email}">
                                </div>
                                <div class="form-group">
                                    <label for="password">密码</label>
                                    <input type="password" name="password" class="form-control" id="password" placeholder="请输入密码">
                                </div>
                                <div class="form-group">
                                    <label for="username">姓名</label>
                                    <input type="text" name="username" class="form-control" id="username" placeholder="请输入用户名" value="${tbUser.username}">
                                </div>
                                <div class="form-group">
                                    <label for="phone">手机</label>
                                    <input type="text" name="phone" class="form-control" id="phone" placeholder="请输入手机号码" value="${tbUser.phone}">
                                </div>

                            </div>
                            <!-- /.card-body -->
                            <div class="card-footer">
                                <button type="button" class="btn btn-default" onclick="history.go(-1)">返回</button>
                                <button type="submit" class="btn btn-primary float-right">提交</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </section>
    </div>


    <!-- /.content-wrapper -->
    <jsp:include page="../includs/copyright.jsp"></jsp:include>
</div>
<jsp:include page="../includs/footer.jsp"></jsp:include>
</body>

</html>
